package com.maodou.core.network

import okhttp3.Interceptor

/**
 * Network configuration used to build OkHttpClient/Retrofit.
 */
 data class HttpConfig(
     val baseUrl: String,
     val connectTimeoutSec: Long = 10,
     val readTimeoutSec: Long = 30,
     val writeTimeoutSec: Long = 30,
     val isDebug: Boolean = false,
     val headerProvider: (() -> Map<String, String>)? = null,
     val interceptors: List<Interceptor> = emptyList(),
     val networkInterceptors: List<Interceptor> = emptyList(),
     // 401/403 等鉴权失败时触发的回调（由 app 层实现清空登录状态与跳转登录）
     val unauthorizedHandler: ((code: Int) -> Unit)? = null
 )